package com.abcd.godating.web;

import java.util.List;

import javax.inject.Inject;

import org.springframework.social.connect.Connection;
import org.springframework.social.connect.ConnectionRepository;
import org.springframework.social.facebook.api.Facebook;
import org.springframework.social.facebook.api.FacebookProfile;
import org.springframework.util.MultiValueMap;
import org.springframework.web.bind.annotation.RequestMapping;

@RequestMapping("/social/*")
public class SocialController {

	@Inject
	private Facebook facebook;

	@Inject
	private ConnectionRepository connectionRepository;

	public MultiValueMap<String, Connection<?>> findAllConnections() {
		return connectionRepository.findAllConnections();
	}

	@RequestMapping(value = "facebook")
	public List<FacebookProfile> getFacebookFriends() {
		return facebook.friendOperations().getFriendProfiles();
	}
}
